﻿Imports SMS.Framework.Core

Namespace SMS.Framework.Scientific

    ' Namespace to work with the astronomy data and operations, etc.
    Namespace Astronomy

        ''' <summary>
        ''' Class to work with the astronomy information relationship with the Earth.
        ''' The cycle of the Earth around the Sun is of 365.24219 days.
        ''' </summary>
        ''' <remarks></remarks>
        Public Class Earth

            Public Enum WeekDay
                Monday
                Tuesday
                Wednesday
                Thursday
                Friday
                Saturday
                Sunday
            End Enum

            Public Enum Calendar
                Julian
                Gregorian
            End Enum

            Public Function DayOfWeek(ByVal data As Date, ByVal calendarType As Calendar) As WeekDay
                Dim result As Byte
                If calendarType = Calendar.Julian Then
                    ' Get the Julian date
                    ' Returns the result of the day of the week
                    Return Conversion.Calendar.DateToJulianDate(data) Mod 7
                Else
                    ' Get the Gregorian date
                    ' Returns the result of the day of the week
                    Return Conversion.Calendar.DateToGregorianDate(data) Mod 7
                End If
            End Function

        End Class

    End Namespace

End Namespace